package AbstractTransactions

import (
	"PaySalary/DataBase"
	"PaySalary/Model"
	"fmt"
	"log"
	"strconv"
)

type ChangeEmployeeTransaction struct {
	itsEmployeeId int
}

func (ce *ChangeEmployeeTransaction)NewChangeEmployeeTransaction(empid int)  {
	ce.itsEmployeeId = empid
}

func (ce *ChangeEmployeeTransaction)Execute() {
	e := DataBase.PayrollDatabase.GetEmployee(ce, ce.itsEmployeeId)

	if e == nil {
		err := fmt.Errorf(DataBase.PayrollExceptionMessage.EmployeeNotExist + strconv.Itoa(ce.itsEmployeeId))
		log.Println(err.Error())
	}

	Change(e)			//啥也不改变
}

func Change(e *Model.Employee)  {

}